package ar.edu.unq.tpi.uis.tepe3.persistencia;

import java.util.ArrayList;
import java.util.List;

import ar.edu.unq.tpi.uis.tepe3.dominio.PrivType;
import ar.edu.unq.tpi.uis.tepe3.dominio.Privilege;

public class PrivilegeDAO extends GenericHibernateDAO<Privilege, Long> {
	
	public PrivilegeDAO(){
		super();
		this.setSession(HibernateUtil.getSessionFactory().getCurrentSession());
	}
	
	public List<PrivType> getPrivTypesInstances(){
		this.getSession().beginTransaction();
		List<PrivType> list = new ArrayList<PrivType>();
		list.addAll(this.getSession().createCriteria("ar.edu.unq.tpi.uis.tepe3.dominio.PrivType").list());
		//list.addAll(this.getSession().createCriteria("PrivTypeRW").list());
		this.getSession().getTransaction().commit();
		return list;
	}
}
